//
//  HDNetWorkTools.swift
//  HDSwfitWeibo
//
//  Created by wty on 16/4/9.
//  Copyright © 2016年 wty. All rights reserved.
//

import  UIKit
import AFNetworking
//枚举 输出网络错误信息
enum HDNetworkErrorEnum:Int {
    case AccessTokenEmpty = -1
    case UidEmpty = -2
    case StatusLoading = -3
    var errorDesciption :String {
        get{
            switch self {
            case AccessTokenEmpty : return "access_token没有值"
            case .UidEmpty : return "uid没有值"
            case  StatusLoading : return "已经在加载了"
            }
        }
    }
    //返回错误方法
    func error() ->NSError {
        return NSError(domain: "cn.wty.HDSwfitWeibo", code: self.rawValue, userInfo: ["errorDescription" : self.errorDesciption])
    }
}
class HDNetWorkTools: AFHTTPSessionManager {
    
    static let shareNetwork : HDNetWorkTools = {
        let tool = HDNetWorkTools()
        tool.responseSerializer.acceptableContentTypes?.insert("text/plain")
        return tool
    }()
    
    //MARK  -根据根据传入的id获取
    
}
